<?php

$appid = 'd2X9MofV34F6S8T_PbHMKpQgKjLx2jJaRYWpxKr1dF6VuHmkj7oUGwjVB2uv6Q--';

if (!isset($_GET['query']))
       die("query was not found in the query string.");

$query = urlencode($_GET['query']);

$url = "http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=$appid&query=$query&output=json";

$response = file_get_contents($url);

echo $response;

?>